зеркало из https://github.com/mozilla/gecko-dev.git
Bug 391800 - left panel view should be able to pass a more than one subject to the right panel view, rs=sdwilsh
This commit is contained in:
Родитель
6df99877eb
Коммит
65af55c036
|
@ -43,22 +43,30 @@
|
|||
* chrome://inspector/content/jsutil/events/ObserverManager.js
|
||||
****************************************************************/
|
||||
|
||||
//////////// global variables /////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Variables
|
||||
|
||||
var viewer;
|
||||
var bundle;
|
||||
var accService;
|
||||
|
||||
//////////// global constants ////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Constants
|
||||
|
||||
const kAccessibleRetrievalCID = "@mozilla.org/accessibleRetrieval;1";
|
||||
|
||||
const nsIAccessibleRetrieval = Components.interfaces.nsIAccessibleRetrieval;
|
||||
const nsIAccessible = Components.interfaces.nsIAccessible;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization/Destruction
|
||||
|
||||
window.addEventListener("load", AccessibleObjectViewer_initialize, false);
|
||||
|
||||
function AccessibleObjectViewer_initialize()
|
||||
{
|
||||
bundle = document.getElementById("inspector-bundle");
|
||||
accService = Components.classes['@mozilla.org/accessibleRetrieval;1']
|
||||
.getService(Components.interfaces.nsIAccessibleRetrieval);
|
||||
accService = XPCU.getService(kAccessibleRetrievalCID, nsIAccessibleRetrieval);
|
||||
|
||||
viewer = new JSObjectViewer();
|
||||
|
||||
|
@ -76,7 +84,11 @@ function AccessibleObjectViewer_initialize()
|
|||
{
|
||||
var accObject = null;
|
||||
try {
|
||||
accObject = accService.getAccessibleFor(aObject);
|
||||
accObject = aObject.getUserData("accessible");
|
||||
if (accObject)
|
||||
XPCU.QI(accObject, nsIAccessible);
|
||||
else
|
||||
accObject = accService.getAccessibleFor(aObject);
|
||||
} catch(e) {
|
||||
dump("Failed to get accessible object for node.");
|
||||
}
|
||||
|
|
|
@ -42,6 +42,16 @@
|
|||
|
||||
var viewer;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Constants
|
||||
|
||||
const kAccessibleRetrievalCID = "@mozilla.org/accessibleRetrieval;1";
|
||||
|
||||
const nsIAccessibleRetrieval = Components.interfaces.nsIAccessibleRetrieval;
|
||||
const nsIAccessible = Components.interfaces.nsIAccessible;
|
||||
|
||||
const nsIPropertyElement = Components.interfaces.nsIPropertyElement;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization/Destruction
|
||||
|
||||
|
@ -59,8 +69,8 @@ function AccessiblePropsViewer()
|
|||
{
|
||||
this.mURL = window.location;
|
||||
this.mObsMan = new ObserverManager(this);
|
||||
this.mAccService = Components.classes["@mozilla.org/accessibleRetrieval;1"]
|
||||
.getService(Components.interfaces.nsIAccessibleRetrieval);
|
||||
this.mAccService = XPCU.getService(kAccessibleRetrievalCID,
|
||||
nsIAccessibleRetrieval);
|
||||
}
|
||||
|
||||
AccessiblePropsViewer.prototype =
|
||||
|
@ -116,7 +126,11 @@ AccessiblePropsViewer.prototype =
|
|||
this.clearView();
|
||||
|
||||
try {
|
||||
this.mAccSubject = this.mAccService.getAccessibleFor(this.mSubject);
|
||||
this.mAccSubject = this.mSubject.getUserData("accessible");
|
||||
if (this.mAccSubject)
|
||||
XPCU.QI(this.mAccSubject, nsIAccessible);
|
||||
else
|
||||
this.mAccSubject = this.mAccService.getAccessibleFor(this.mSubject);
|
||||
} catch(e) {
|
||||
dump("Failed to get accessible object for node.");
|
||||
return;
|
||||
|
@ -148,7 +162,7 @@ AccessiblePropsViewer.prototype =
|
|||
|
||||
addAccessibleAttribute: function addAccessibleAttribute(aElement)
|
||||
{
|
||||
var prop = aElement.QueryInterface(Components.interfaces.nsIPropertyElement);
|
||||
var prop = XPCU.QI(aElement, nsIPropertyElement);
|
||||
|
||||
var trAttrBody = document.getElementById("trAttrBody");
|
||||
|
||||
|
|
|
@ -389,7 +389,9 @@ inAccTreeView.prototype.getDOMNodeFor =
|
|||
function getDOMNodeFor(aAccessible)
|
||||
{
|
||||
var accessNode = XPCU.QI(aAccessible, nsIAccessNode);
|
||||
return accessNode.DOMNode;
|
||||
var DOMNode = accessNode.DOMNode;
|
||||
DOMNode.setUserData("accessible", aAccessible, null);
|
||||
return DOMNode;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче