Bug 268935. nsIAccessibilityService should not be scriptable -- only the nsIAccessibleRetrieval that it inherits from. r=surkov
authoraaronleventhal@moonset.net
Wed, 16 May 2007 06:38:05 -0700
changeset 1515 73f88382fc87e248b87c145af20fb6b00991e9a5
parent 1514 a538914797f1d32639b4d30059589676ce59c319
child 1516 e7a3ba28ebd4f13ba882cbdac0ef7811560bece0
push idunknown
push userunknown
push dateunknown
reviewerssurkov
bugs268935
milestone1.9a5pre
Bug 268935. nsIAccessibilityService should not be scriptable -- only the nsIAccessibleRetrieval that it inherits from. r=surkov
accessible/public/nsIAccessibilityService.idl
extensions/inspector/resources/content/inspector.js
extensions/inspector/resources/content/res/viewer-registry.rdf
extensions/inspector/resources/content/viewers/accessibleObject/accessibleObject.js
extensions/inspector/resources/content/viewers/dom/dom.js
xpfe/global/resources/content/bindings/tabbox.xml
--- a/accessible/public/nsIAccessibilityService.idl
+++ b/accessible/public/nsIAccessibilityService.idl
@@ -40,28 +40,28 @@
 #include "nsIAccessibleRetrieval.idl"
 
 interface nsIAccessibleEventListener;
 interface nsIDocument;
 interface nsIFrame;
 interface nsObjectFrame;
 interface nsIContent;
 
-[scriptable, uuid(e4cdb7c5-d029-4bee-bff5-99455c6e0057)]
+[uuid(e4cdb7c5-d029-4bee-bff5-99455c6e0057)]
 interface nsIAccessibilityService : nsIAccessibleRetrieval
 {
   nsIAccessible createOuterDocAccessible(in nsIDOMNode aNode);
   nsIAccessible createRootAccessible(in nsIPresShell aShell, in nsIDocument aDocument);
 
   nsIAccessible createHTML4ButtonAccessible(in nsISupports aFrame);
   nsIAccessible createHTMLAreaAccessible(in nsIWeakReference aPresShell, in nsIDOMNode aDOMNode, in nsIAccessible aAccParent);
   nsIAccessible createHyperTextAccessible(in nsISupports aFrame);
   nsIAccessible createHTMLBRAccessible(in nsISupports aFrame);
   nsIAccessible createHTMLButtonAccessible(in nsISupports aFrame);
-  [noscript] nsIAccessible createHTMLAccessibleByMarkup(in nsIFrame aFrame, in nsIWeakReference aWeakShell, in nsIDOMNode aDOMNode, in AString aRole);
+  nsIAccessible createHTMLAccessibleByMarkup(in nsIFrame aFrame, in nsIWeakReference aWeakShell, in nsIDOMNode aDOMNode, in AString aRole);
   nsIAccessible createHTMLLIAccessible(in nsISupports aFrame, in nsISupports aBulletFrame, in AString aBulletText);
   nsIAccessible createHTMLCheckboxAccessible(in nsISupports aFrame);
   nsIAccessible createHTMLComboboxAccessible(in nsIDOMNode aNode, in nsIWeakReference aPresShell);
   nsIAccessible createHTMLGenericAccessible(in nsISupports aFrame);
   nsIAccessible createHTMLGroupboxAccessible(in nsISupports aFrame);
   nsIAccessible createHTMLHRAccessible(in nsISupports aFrame);
   nsIAccessible createHTMLImageAccessible(in nsISupports aFrame);
   nsIAccessible createHTMLLabelAccessible(in nsISupports aFrame);
@@ -70,39 +70,39 @@ interface nsIAccessibilityService : nsIA
   nsIAccessible createHTMLRadioButtonAccessible(in nsISupports aFrame);
   nsIAccessible createHTMLSelectOptionAccessible(in nsIDOMNode aNode, in nsIAccessible aAccParent, in nsIWeakReference aPresShell);
   nsIAccessible createHTMLTableAccessible(in nsISupports aFrame);
   nsIAccessible createHTMLTableCellAccessible(in nsISupports aFrame);
   nsIAccessible createHTMLTableHeadAccessible(in nsIDOMNode aDOMNode);
   nsIAccessible createHTMLTextAccessible(in nsISupports aFrame);
   nsIAccessible createHTMLTextFieldAccessible(in nsISupports aFrame);
 
-  [noscript] nsIAccessible getAccessible(in nsIDOMNode aNode, in nsIPresShell aPresShell,                          
+  nsIAccessible getAccessible(in nsIDOMNode aNode, in nsIPresShell aPresShell,                          
                               in nsIWeakReference aWeakShell, 
                               inout nsIFrame frameHint, out boolean aIsHidden);
 
   // For gtk+ native window accessible
-  [noscript] nsIAccessible addNativeRootAccessible(in voidPtr aAtkAccessible);
-  [noscript] void removeNativeRootAccessible(in nsIAccessible aRootAccessible);
+  nsIAccessible addNativeRootAccessible(in voidPtr aAtkAccessible);
+  void removeNativeRootAccessible(in nsIAccessible aRootAccessible);
 
   /**
    * Invalidate the accessibility cache associated with aPresShell, for accessibles
    * that were generated for aContainerContent and it's subtree.
    * The container content node for the change is passed in, rather than the
    * changed presentation for the content node itself.
    * @param aPresShell         The presShell where changes occured
    * @param aChangeContent     The affected DOM content
    * @param aEvent             The event from nsIAccessibleEvent that
    *                           caused the change:
    *                           Must be one of:
    *                           EVENT_REORDER (change),
    *                           EVENT_SHOW (make visible or create) or 
    *                           EVENT_HIDE (destroy or hide)
    */
-  [noscript] void invalidateSubtreeFor(in nsIPresShell aPresShell,
+  void invalidateSubtreeFor(in nsIPresShell aPresShell,
                                        in nsIContent aChangedContent,
                                        in PRUint32 aEvent);
 };
 
 
 %{ C++
 
 // for component registration
--- a/extensions/inspector/resources/content/inspector.js
+++ b/extensions/inspector/resources/content/inspector.js
@@ -129,17 +129,17 @@ InspectorApp.prototype =
 
     this.mPanelSet = document.getElementById("bxPanelSet");
     this.mPanelSet.addObserver("panelsetready", this, false);
     this.mPanelSet.initialize();
 
     // check if accessibility service is available
     var cmd = document.getElementById("cmd:toggleAccessibleNodes");
     if (cmd) {
-      if (!("@mozilla.org/accessibilityService;1" in Components.classes))
+      if (!("@mozilla.org/accessibleRetrieval;1" in Components.classes))
         cmd.setAttribute("disabled", "true");
     }
 
     if (aURI) {
       this.gotoURL(aURI);
     }
   },
 
--- a/extensions/inspector/resources/content/res/viewer-registry.rdf
+++ b/extensions/inspector/resources/content/res/viewer-registry.rdf
@@ -98,18 +98,18 @@
         <ins:filter><![CDATA[
           if (!linkedViewer || linkedViewer.uid != "dom" ||
               !linkedViewer.getAccessibleNodes() ||
               !(object instanceof Components.interfaces.nsIDOMNode))
             return false;
 
           try {
             var accService =
-              Components.classes['@mozilla.org/accessibilityService;1']
-                        .getService(Components.interfaces.nsIAccessibilityService);
+              Components.classes["@mozilla.org/accessibleRetrieval;1"]
+                        .getService(Components.interfaces.nsIAccessibleRetrieval);
 
             return accService.getAttachedAccessibleFor(object);
           } catch(e) {
             return false;
           }
         ]]></ins:filter>
       </rdf:Description>
     </rdf:li>
--- a/extensions/inspector/resources/content/viewers/accessibleObject/accessibleObject.js
+++ b/extensions/inspector/resources/content/viewers/accessibleObject/accessibleObject.js
@@ -52,18 +52,18 @@ var accService;
 //////////// global constants ////////////////////
 //////////////////////////////////////////////////
 
 window.addEventListener("load", AccessibleObjectViewer_initialize, false);
 
 function AccessibleObjectViewer_initialize()
 {
   bundle = document.getElementById("inspector-bundle");
-  accService = Components.classes['@mozilla.org/accessibilityService;1']
-                         .getService(Components.interfaces.nsIAccessibilityService);
+  accService = Components.classes['@mozilla.org/accessibleRetrieval;1']
+                         .getService(Components.interfaces.nsIAccessibleRetrieval);
 
   viewer = new JSObjectViewer();
 
   viewer.__defineGetter__(
     "uid",
     function uidGetter()
     {
       return "accessibleObject";
--- a/extensions/inspector/resources/content/viewers/dom/dom.js
+++ b/extensions/inspector/resources/content/viewers/dom/dom.js
@@ -330,17 +330,17 @@ DOMViewer.prototype =
 
   /**
    * Set state of 'Show Accessible Nodes' option.
    *
    * @param Boolean aValue - if true then accessible nodes will be shown
    */
   setAccessibleNodes: function setAccessibleNodes(aValue)
   {
-    if (!("@mozilla.org/accessibilityService;1" in Components.classes))
+    if (!("@mozilla.org/accessibleRetrieval;1" in Components.classes))
       aValue = false;
 
     this.mDOMView.showAccessibleNodes = aValue;
     this.mPanel.panelset.setCommandAttribute("cmd:toggleAccessibleNodes",
                                              "checked", aValue);
     this.onItemSelected();
   },
 
--- a/xpfe/global/resources/content/bindings/tabbox.xml
+++ b/xpfe/global/resources/content/bindings/tabbox.xml
@@ -9,21 +9,20 @@
     <resources>
       <stylesheet src="chrome://global/skin/tabbox.css"/>
     </resources>
   </binding>
 
   <binding id="tabbox"
            extends="chrome://global/content/bindings/tabbox.xml#tab-base">
     <implementation implements="nsIDOMEventListener, nsIAccessibleProvider">
-      <property name="accessible">
+      <property name="accessibleType" readonly="true">
         <getter>
           <![CDATA[
-            var accService = Components.classes["@mozilla.org/accessibilityService;1"].getService(Components.interfaces.nsIAccessibilityService);
-            return accService.createXULTabBoxAccessible(this);
+            return Components.interfaces.nsIAccessibleProvider.XULTabBox;
           ]]>
         </getter>
       </property>
 
       <property name="handleCtrlTab">
         <setter>
         <![CDATA[
           this.setAttribute("handleCtrlTab", val);