toolkit/content/widgets/editor.xml

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 <?xml version="1.0"?>
michael@0 2 <!-- This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 - License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
michael@0 5
michael@0 6
michael@0 7 <bindings id="editorBindings"
michael@0 8 xmlns="http://www.mozilla.org/xbl"
michael@0 9 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
michael@0 10 xmlns:xbl="http://www.mozilla.org/xbl">
michael@0 11
michael@0 12 <binding id="editor" role="outerdoc">
michael@0 13 <implementation type="application/javascript">
michael@0 14 <constructor>
michael@0 15 <![CDATA[
michael@0 16 // Make window editable immediately only
michael@0 17 // if the "editortype" attribute is supplied
michael@0 18 // This allows using same contentWindow for different editortypes,
michael@0 19 // where the type is determined during the apps's window.onload handler.
michael@0 20 if (this.editortype)
michael@0 21 this.makeEditable(this.editortype, true);
michael@0 22 ]]>
michael@0 23 </constructor>
michael@0 24 <destructor/>
michael@0 25
michael@0 26 <field name="_editorContentListener">
michael@0 27 <![CDATA[
michael@0 28 ({
michael@0 29 QueryInterface: function(iid)
michael@0 30 {
michael@0 31 if (iid.equals(Components.interfaces.nsIURIContentListener) ||
michael@0 32 iid.equals(Components.interfaces.nsISupportsWeakReference) ||
michael@0 33 iid.equals(Components.interfaces.nsISupports))
michael@0 34 return this;
michael@0 35
michael@0 36 throw Components.results.NS_ERROR_NO_INTERFACE;
michael@0 37 },
michael@0 38 onStartURIOpen: function(uri)
michael@0 39 {
michael@0 40 return false;
michael@0 41 },
michael@0 42 doContent: function(contentType, isContentPreferred, request, contentHandler)
michael@0 43 {
michael@0 44 return false;
michael@0 45 },
michael@0 46 isPreferred: function(contentType, desiredContentType)
michael@0 47 {
michael@0 48 return false;
michael@0 49 },
michael@0 50 canHandleContent: function(contentType, isContentPreferred, desiredContentType)
michael@0 51 {
michael@0 52 return false;
michael@0 53 },
michael@0 54 loadCookie: null,
michael@0 55 parentContentListener: null
michael@0 56 })
michael@0 57 ]]>
michael@0 58 </field>
michael@0 59 <method name="makeEditable">
michael@0 60 <parameter name="editortype"/>
michael@0 61 <parameter name="waitForUrlLoad"/>
michael@0 62 <body>
michael@0 63 <![CDATA[
michael@0 64 this.editingSession.makeWindowEditable(this.contentWindow, editortype, waitForUrlLoad, true, false);
michael@0 65 this.setAttribute("editortype", editortype);
michael@0 66
michael@0 67 this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
michael@0 68 .getInterface(Components.interfaces.nsIURIContentListener)
michael@0 69 .parentContentListener = this._editorContentListener;
michael@0 70 ]]>
michael@0 71 </body>
michael@0 72 </method>
michael@0 73 <method name="getEditor">
michael@0 74 <parameter name="containingWindow"/>
michael@0 75 <body>
michael@0 76 <![CDATA[
michael@0 77 return this.editingSession.getEditorForWindow(containingWindow);
michael@0 78 ]]>
michael@0 79 </body>
michael@0 80 </method>
michael@0 81 <method name="getHTMLEditor">
michael@0 82 <parameter name="containingWindow"/>
michael@0 83 <body>
michael@0 84 <![CDATA[
michael@0 85 var editor = this.editingSession.getEditorForWindow(containingWindow);
michael@0 86 return editor.QueryInterface(Components.interfaces.nsIHTMLEditor);
michael@0 87 ]]>
michael@0 88 </body>
michael@0 89 </method>
michael@0 90
michael@0 91 <field name="_finder">null</field>
michael@0 92 <property name="finder" readonly="true">
michael@0 93 <getter><![CDATA[
michael@0 94 if (!this._finder) {
michael@0 95 if (!this.docShell)
michael@0 96 return null;
michael@0 97
michael@0 98 let Finder = Components.utils.import("resource://gre/modules/Finder.jsm", {}).Finder;
michael@0 99 this._finder = new Finder(this.docShell);
michael@0 100 }
michael@0 101 return this._finder;
michael@0 102 ]]></getter>
michael@0 103 </property>
michael@0 104
michael@0 105 <field name="_fastFind">null</field>
michael@0 106 <property name="fastFind"
michael@0 107 readonly="true">
michael@0 108 <getter>
michael@0 109 <![CDATA[
michael@0 110 if (!this._fastFind) {
michael@0 111 if (!("@mozilla.org/typeaheadfind;1" in Components.classes))
michael@0 112 return null;
michael@0 113
michael@0 114 if (!this.docShell)
michael@0 115 return null;
michael@0 116
michael@0 117 this._fastFind = Components.classes["@mozilla.org/typeaheadfind;1"]
michael@0 118 .createInstance(Components.interfaces.nsITypeAheadFind);
michael@0 119 this._fastFind.init(this.docShell);
michael@0 120 }
michael@0 121 return this._fastFind;
michael@0 122 ]]>
michael@0 123 </getter>
michael@0 124 </property>
michael@0 125
michael@0 126 <field name="_lastSearchString">null</field>
michael@0 127 <field name="_lastSearchHighlight">false</field>
michael@0 128
michael@0 129 <property name="editortype"
michael@0 130 onget="return this.getAttribute('editortype');"
michael@0 131 onset="this.setAttribute('editortype', val); return val;"/>
michael@0 132 <property name="webNavigation"
michael@0 133 onget="return this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation);"
michael@0 134 readonly="true"/>
michael@0 135 <property name="contentDocument" readonly="true"
michael@0 136 onget="return this.webNavigation.document;"/>
michael@0 137 <property name="docShell"
michael@0 138 onget="return this.boxObject.QueryInterface(Components.interfaces.nsIContainerBoxObject).docShell;"
michael@0 139 readonly="true"/>
michael@0 140 <property name="currentURI"
michael@0 141 readonly="true"
michael@0 142 onget="return this.webNavigation.currentURI;"/>
michael@0 143 <property name="contentWindow"
michael@0 144 readonly="true"
michael@0 145 onget="return this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow);"/>
michael@0 146 <property name="webBrowserFind"
michael@0 147 readonly="true"
michael@0 148 onget="return this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebBrowserFind);"/>
michael@0 149 <property name="markupDocumentViewer"
michael@0 150 readonly="true"
michael@0 151 onget="return this.docShell.contentViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);"/>
michael@0 152 <property name="editingSession"
michael@0 153 readonly="true"
michael@0 154 onget="return this.webNavigation.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIEditingSession);"/>
michael@0 155 <property name="commandManager"
michael@0 156 readonly="true"
michael@0 157 onget="return this.webNavigation.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsICommandManager);"/>
michael@0 158 <property name="fullZoom"
michael@0 159 onget="return this.markupDocumentViewer.fullZoom;"
michael@0 160 onset="this.markupDocumentViewer.fullZoom = val;"/>
michael@0 161 <property name="textZoom"
michael@0 162 onget="return this.markupDocumentViewer.textZoom;"
michael@0 163 onset="this.markupDocumentViewer.textZoom = val;"/>
michael@0 164 <property name="isSyntheticDocument"
michael@0 165 onget="return this.contentDocument.isSyntheticDocument;"
michael@0 166 readonly="true"/>
michael@0 167 </implementation>
michael@0 168 </binding>
michael@0 169
michael@0 170 </bindings>
michael@0 171

mercurial