зеркало из https://github.com/mozilla/gecko-dev.git
Bug 739524 - replace TreeViewChanged DOM event on direct call from XUL tree, r=tbsaunde, f=surkov
This commit is contained in:
Родитель
4ea8a5a78f
Коммит
7dbe0c1ec1
|
@ -596,6 +596,22 @@ nsAccessibilityService::UpdateText(nsIPresShell* aPresShell,
|
|||
document->UpdateText(aContent);
|
||||
}
|
||||
|
||||
void
|
||||
nsAccessibilityService::TreeViewChanged(nsIPresShell* aPresShell,
|
||||
nsIContent* aContent,
|
||||
nsITreeView* aView)
|
||||
{
|
||||
nsDocAccessible* document = GetDocAccessible(aPresShell->GetDocument());
|
||||
if (document) {
|
||||
nsAccessible* accessible = document->GetAccessible(aContent);
|
||||
if (accessible) {
|
||||
nsRefPtr<nsXULTreeAccessible> treeAcc = do_QueryObject(accessible);
|
||||
if (treeAcc)
|
||||
treeAcc->TreeViewChanged(aView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsAccessibilityService::UpdateListBullet(nsIPresShell* aPresShell,
|
||||
nsIContent* aHTMLListItemContent,
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#include "nsIObserver.h"
|
||||
|
||||
class nsImageFrame;
|
||||
class nsITreeView;
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
@ -152,6 +153,12 @@ public:
|
|||
|
||||
virtual void UpdateText(nsIPresShell* aPresShell, nsIContent* aContent);
|
||||
|
||||
/**
|
||||
* Update XUL:tree accessible tree when treeview is changed.
|
||||
*/
|
||||
void TreeViewChanged(nsIPresShell* aPresShell, nsIContent* aContent,
|
||||
nsITreeView* aView);
|
||||
|
||||
/**
|
||||
* Update list bullet accessible.
|
||||
*/
|
||||
|
|
|
@ -229,8 +229,6 @@ const char* const docEvents[] = {
|
|||
"ValueChange",
|
||||
// capture AlertActive events (fired whenever alert pops up)
|
||||
"AlertActive",
|
||||
// add ourself as a TreeViewChanged listener (custom event fired in nsTreeBodyFrame.cpp)
|
||||
"TreeViewChanged",
|
||||
"TreeRowCountChanged",
|
||||
"TreeInvalidated",
|
||||
// add ourself as a OpenStateChange listener (custom event fired in tree.xml)
|
||||
|
@ -394,11 +392,6 @@ nsRootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
|
|||
kNameSpaceID_XUL)) {
|
||||
treeAcc = do_QueryObject(accessible);
|
||||
if (treeAcc) {
|
||||
if (eventType.EqualsLiteral("TreeViewChanged")) {
|
||||
treeAcc->TreeViewChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
if (eventType.EqualsLiteral("TreeRowCountChanged")) {
|
||||
HandleTreeRowCountChangedEvent(aDOMEvent, treeAcc);
|
||||
return;
|
||||
|
|
|
@ -688,7 +688,7 @@ nsXULTreeAccessible::TreeViewInvalidated(PRInt32 aStartRow, PRInt32 aEndRow,
|
|||
}
|
||||
|
||||
void
|
||||
nsXULTreeAccessible::TreeViewChanged()
|
||||
nsXULTreeAccessible::TreeViewChanged(nsITreeView* aView)
|
||||
{
|
||||
if (IsDefunct())
|
||||
return;
|
||||
|
@ -704,7 +704,7 @@ nsXULTreeAccessible::TreeViewChanged()
|
|||
|
||||
// Clear cache.
|
||||
ClearCache(mAccessibleCache);
|
||||
mTree->GetView(getter_AddRefs(mTreeView));
|
||||
mTreeView = aView;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -146,7 +146,7 @@ public:
|
|||
/**
|
||||
* Invalidates children created for previous tree view.
|
||||
*/
|
||||
void TreeViewChanged();
|
||||
void TreeViewChanged(nsITreeView* aView);
|
||||
|
||||
protected:
|
||||
/**
|
||||
|
|
|
@ -3,13 +3,8 @@
|
|||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
|
||||
<!--
|
||||
Bug 368835 - fire TreeViewChanged/TreeRowCountChanged events.
|
||||
Bug 308564 - no accessibility events when data in a tree row changes.
|
||||
-->
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="DOM TreeViewChanged/TreeRowCountChanged and a11y name change events.">
|
||||
title="DOM TreeRowCountChanged and a11y name change events.">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
|
@ -28,20 +23,6 @@
|
|||
////////////////////////////////////////////////////////////////////////////
|
||||
// Invoker's checkers
|
||||
|
||||
/**
|
||||
* Check TreeViewChanged event and run through accessible tree to ensure
|
||||
* it's created.
|
||||
*/
|
||||
function treeViewChangedChecker(aMsg)
|
||||
{
|
||||
this.type = "TreeViewChanged";
|
||||
this.target = gTree;
|
||||
this.getID = function getID()
|
||||
{
|
||||
return "TreeViewChanged";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check TreeRowCountChanged event.
|
||||
*/
|
||||
|
@ -120,7 +101,7 @@
|
|||
// Invokers
|
||||
|
||||
/**
|
||||
* Set tree view and process TreeViewChanged handler.
|
||||
* Set tree view.
|
||||
*/
|
||||
function setTreeView()
|
||||
{
|
||||
|
@ -132,7 +113,6 @@
|
|||
this.getID = function setTreeView_getID() { return "set tree view"; }
|
||||
|
||||
this.eventSeq = [
|
||||
new treeViewChangedChecker(),
|
||||
new invokerChecker(EVENT_REORDER, gTree)
|
||||
];
|
||||
};
|
||||
|
@ -298,6 +278,11 @@
|
|||
title="No accessibility events when data in a tree row changes.">
|
||||
Mozilla Bug 308564
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=739524"
|
||||
title="replace TreeViewChanged DOM event on direct call from XUL tree.">
|
||||
Mozilla Bug 739524
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
|
|
|
@ -103,6 +103,9 @@
|
|||
#include "nsRenderingContext.h"
|
||||
#include "nsIScriptableRegion.h"
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
#include "nsAccessibilityService.h"
|
||||
#endif
|
||||
#ifdef IBMBIDI
|
||||
#include "nsBidiUtils.h"
|
||||
#endif
|
||||
|
@ -519,6 +522,11 @@ nsTreeBodyFrame::SetView(nsITreeView * aView)
|
|||
|
||||
nsIContent *treeContent = GetBaseElement();
|
||||
if (treeContent) {
|
||||
#ifdef ACCESSIBILITY
|
||||
nsAccessibilityService* accService = nsIPresShell::AccService();
|
||||
if (accService)
|
||||
accService->TreeViewChanged(PresContext()->GetPresShell(), treeContent, mView);
|
||||
#endif
|
||||
FireDOMEvent(NS_LITERAL_STRING("TreeViewChanged"), treeContent);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче