DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (a81015259a98)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
<?xml version="1.0"?>

<bindings id="editorBindings"
   xmlns="http://www.mozilla.org/xbl"
   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
   xmlns:xbl="http://www.mozilla.org/xbl">
  
  <binding id="editor">
    <implementation type="application/javascript" implements="nsIAccessibleProvider">
      <constructor>
        <![CDATA[
          // Make window editable immediately only
          //   if the "editortype" attribute is supplied
          // This allows using same contentWindow for different editortypes,
          //   where the type is determined during the apps's window.onload handler.
          if (this.editortype)
            this.makeEditable(this.editortype, true);
        ]]>
      </constructor>
      <destructor/>

      <property name="accessibleType" readonly="true">
        <getter>
          <![CDATA[
            return Components.interfaces.nsIAccessibleProvider.OuterDoc;
          ]]>
        </getter>
      </property>

      <field name="_editorContentListener">
        <![CDATA[
          ({
            QueryInterface: function(iid)
            {
              if (iid.equals(Components.interfaces.nsIURIContentListener) ||
                  iid.equals(Components.interfaces.nsISupportsWeakReference) ||
                  iid.equals(Components.interfaces.nsISupports))
              return this;

              throw Components.results.NS_ERROR_NO_INTERFACE;
            },
            onStartURIOpen: function(uri)
            {
              return false;
            },
            doContent: function(contentType, isContentPreferred, request, contentHandler)
            {
              return false;
            },
            isPreferred: function(contentType, desiredContentType)
            {
              return false;
            },
            canHandleContent: function(contentType, isContentPreferred, desiredContentType)
            {
              return false;
            },
            loadCookie: null,
            parentContentListener: null
          })
        ]]>
      </field>
      <method name="makeEditable">
        <parameter name="editortype"/>
        <parameter name="waitForUrlLoad"/>
        <body>
        <![CDATA[
          this.editingSession.makeWindowEditable(this.contentWindow, editortype, waitForUrlLoad, true, false);
          this.setAttribute("editortype", editortype);

          this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
              .getInterface(Components.interfaces.nsIURIContentListener)
              .parentContentListener = this._editorContentListener;
        ]]>
        </body>
      </method>
      <method name="getEditor">
        <parameter name="containingWindow"/>
        <body>
        <![CDATA[
          return this.editingSession.getEditorForWindow(containingWindow);
        ]]>
        </body>
      </method>
      <method name="getHTMLEditor">
        <parameter name="containingWindow"/>
        <body>
        <![CDATA[
          var editor = this.editingSession.getEditorForWindow(containingWindow);
          return editor.QueryInterface(Components.interfaces.nsIHTMLEditor);
        ]]>
        </body>
      </method>
      <property name="editortype"
                onget="return this.getAttribute('editortype');"
                onset="this.setAttribute('editortype', val); return val;"/>
      <property name="webNavigation"
                onget="return this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation);"
                readonly="true"/>
      <property name="contentDocument" readonly="true"
                onget="return this.webNavigation.document;"/>
      <property name="docShell"
                onget="return this.boxObject.QueryInterface(Components.interfaces.nsIContainerBoxObject).docShell;"
                readonly="true"/>
      <property name="currentURI"
                readonly="true"
                onget="return this.webNavigation.currentURI;"/>
      <property name="contentWindow"
                readonly="true"
                onget="return this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow);"/>
      <property name="webBrowserFind"
                readonly="true"
                onget="return this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebBrowserFind);"/>
      <property name="editingSession"
                readonly="true"
                onget="return this.webNavigation.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIEditingSession);"/>
      <property name="commandManager"
                readonly="true"
                onget="return this.webNavigation.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsICommandManager);"/>
    </implementation>
  </binding>

</bindings>