toolkit/content/widgets/general.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="generalBindings"
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="basecontrol">
michael@0 13 <implementation implements="nsIDOMXULControlElement">
michael@0 14 <!-- public implementation -->
michael@0 15 <property name="disabled" onset="if (val) this.setAttribute('disabled', 'true');
michael@0 16 else this.removeAttribute('disabled');
michael@0 17 return val;"
michael@0 18 onget="return this.getAttribute('disabled') == 'true';"/>
michael@0 19 <property name="tabIndex" onget="return parseInt(this.getAttribute('tabindex')) || 0"
michael@0 20 onset="if (val) this.setAttribute('tabindex', val);
michael@0 21 else this.removeAttribute('tabindex'); return val;"/>
michael@0 22 </implementation>
michael@0 23 </binding>
michael@0 24
michael@0 25 <binding id="basetext" extends="chrome://global/content/bindings/general.xml#basecontrol">
michael@0 26 <implementation implements="nsIDOMXULLabeledControlElement">
michael@0 27 <!-- public implementation -->
michael@0 28 <property name="label" onset="this.setAttribute('label',val); return val;"
michael@0 29 onget="return this.getAttribute('label');"/>
michael@0 30 <property name="crop" onset="this.setAttribute('crop',val); return val;"
michael@0 31 onget="return this.getAttribute('crop');"/>
michael@0 32 <property name="image" onset="this.setAttribute('image',val); return val;"
michael@0 33 onget="return this.getAttribute('image');"/>
michael@0 34 <property name="command" onset="this.setAttribute('command',val); return val;"
michael@0 35 onget="return this.getAttribute('command');"/>
michael@0 36 <property name="accessKey">
michael@0 37 <getter>
michael@0 38 <![CDATA[
michael@0 39 return this.labelElement ? this.labelElement.accessKey : this.getAttribute('accesskey');
michael@0 40 ]]>
michael@0 41 </getter>
michael@0 42 <setter>
michael@0 43 <![CDATA[
michael@0 44 // Always store on the control
michael@0 45 this.setAttribute('accesskey', val);
michael@0 46 // If there is a label, change the accesskey on the labelElement
michael@0 47 // if it's also set there
michael@0 48 if (this.labelElement) {
michael@0 49 this.labelElement.accessKey = val;
michael@0 50 }
michael@0 51 return val;
michael@0 52 ]]>
michael@0 53 </setter>
michael@0 54 </property>
michael@0 55
michael@0 56 <field name="labelElement"/>
michael@0 57 </implementation>
michael@0 58 </binding>
michael@0 59
michael@0 60 <binding id="control-item" extends="chrome://global/content/bindings/general.xml#basetext">
michael@0 61 <implementation>
michael@0 62 <property name="value" onset="this.setAttribute('value', val); return val;"
michael@0 63 onget="return this.getAttribute('value');"/>
michael@0 64 </implementation>
michael@0 65 </binding>
michael@0 66
michael@0 67 <binding id="root-element">
michael@0 68 <implementation>
michael@0 69 <field name="_lightweightTheme">null</field>
michael@0 70 <constructor><![CDATA[
michael@0 71 if (this.hasAttribute("lightweightthemes")) {
michael@0 72 let temp = {};
michael@0 73 Components.utils.import("resource://gre/modules/LightweightThemeConsumer.jsm", temp);
michael@0 74 this._lightweightTheme = new temp.LightweightThemeConsumer(this.ownerDocument);
michael@0 75 }
michael@0 76 ]]></constructor>
michael@0 77 <destructor><![CDATA[
michael@0 78 if (this._lightweightTheme) {
michael@0 79 this._lightweightTheme.destroy();
michael@0 80 this._lightweightTheme = null;
michael@0 81 }
michael@0 82 ]]></destructor>
michael@0 83 </implementation>
michael@0 84 </binding>
michael@0 85
michael@0 86 <binding id="iframe" role="outerdoc">
michael@0 87 <implementation>
michael@0 88 <property name="docShell"
michael@0 89 readonly="true"
michael@0 90 onget="return this.boxObject.QueryInterface(Components.interfaces.nsIContainerBoxObject).docShell"/>
michael@0 91 <property name="contentWindow"
michael@0 92 readonly="true"
michael@0 93 onget="return this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow);"/>
michael@0 94 <property name="webNavigation"
michael@0 95 onget="return this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation);"
michael@0 96 readonly="true"/>
michael@0 97 <property name="contentDocument" readonly="true"
michael@0 98 onget="return this.webNavigation.document;"/>
michael@0 99 </implementation>
michael@0 100 </binding>
michael@0 101
michael@0 102 <binding id="statusbarpanel" display="xul:button">
michael@0 103 <content>
michael@0 104 <children>
michael@0 105 <xul:label class="statusbarpanel-text" xbl:inherits="value=label,crop" crop="right" flex="1"/>
michael@0 106 </children>
michael@0 107 </content>
michael@0 108
michael@0 109 <implementation>
michael@0 110 <property name="label"
michael@0 111 onget="return this.getAttribute('label');"
michael@0 112 onset="this.setAttribute('label',val); return val;"/>
michael@0 113 <property name="image"
michael@0 114 onget="return this.getAttribute('image');"
michael@0 115 onset="this.setAttribute('image',val); return val;"/>
michael@0 116 <property name="src"
michael@0 117 onget="return this.getAttribute('src');"
michael@0 118 onset="this.setAttribute('src',val); return val;"/>
michael@0 119 </implementation>
michael@0 120 </binding>
michael@0 121
michael@0 122 <binding id="statusbarpanel-menu-iconic" display="xul:menu"
michael@0 123 extends="chrome://global/content/bindings/general.xml#statusbarpanel">
michael@0 124 <content>
michael@0 125 <xul:image class="statusbarpanel-icon" xbl:inherits="src,src=image"/>
michael@0 126 <children/>
michael@0 127 </content>
michael@0 128 </binding>
michael@0 129
michael@0 130 <binding id="statusbar" role="xul:statusbar">
michael@0 131 <content>
michael@0 132 <children/>
michael@0 133 <xul:statusbarpanel class="statusbar-resizerpanel">
michael@0 134 <xul:resizer dir="bottomend"/>
michael@0 135 </xul:statusbarpanel>
michael@0 136 </content>
michael@0 137 </binding>
michael@0 138
michael@0 139 <binding id="statusbar-drag"
michael@0 140 extends="chrome://global/content/bindings/general.xml#statusbar">
michael@0 141 <implementation>
michael@0 142 <field name="_dragBindingAlive">true</field>
michael@0 143 <constructor>
michael@0 144 if (!this._draggableStarted) {
michael@0 145 this._draggableStarted = true;
michael@0 146 try {
michael@0 147 let tmp = {};
michael@0 148 Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
michael@0 149 let draghandle = new tmp.WindowDraggingElement(this);
michael@0 150 draghandle.mouseDownCheck = function () this._dragBindingAlive;
michael@0 151 } catch (e) {}
michael@0 152 }
michael@0 153 </constructor>
michael@0 154 </implementation>
michael@0 155 </binding>
michael@0 156
michael@0 157 <binding id="statusbarpanel-iconic" display="xul:button" role="xul:button"
michael@0 158 extends="chrome://global/content/bindings/general.xml#statusbarpanel">
michael@0 159 <content>
michael@0 160 <xul:image class="statusbarpanel-icon" xbl:inherits="src,src=image"/>
michael@0 161 </content>
michael@0 162 </binding>
michael@0 163
michael@0 164 <binding id="statusbarpanel-iconic-text" display="xul:button" role="xul:button"
michael@0 165 extends="chrome://global/content/bindings/general.xml#statusbarpanel">
michael@0 166 <content>
michael@0 167 <xul:image class="statusbarpanel-icon" xbl:inherits="src,src=image"/>
michael@0 168 <xul:label class="statusbarpanel-text" xbl:inherits="value=label,crop"/>
michael@0 169 </content>
michael@0 170 </binding>
michael@0 171
michael@0 172 <binding id="image" role="xul:image">
michael@0 173 <implementation implements="nsIDOMXULImageElement">
michael@0 174 <property name="src"
michael@0 175 onget="return this.getAttribute('src');"
michael@0 176 onset="this.setAttribute('src',val); return val;"/>
michael@0 177 </implementation>
michael@0 178 </binding>
michael@0 179
michael@0 180 <binding id="deck">
michael@0 181 <implementation>
michael@0 182 <property name="selectedIndex"
michael@0 183 onget="return this.getAttribute('selectedIndex') || '0'">
michael@0 184 <setter>
michael@0 185 <![CDATA[
michael@0 186 if (this.selectedIndex == val)
michael@0 187 return val;
michael@0 188 this.setAttribute("selectedIndex", val);
michael@0 189 var event = document.createEvent('Events');
michael@0 190 event.initEvent('select', true, true);
michael@0 191 this.dispatchEvent(event);
michael@0 192 return val;
michael@0 193 ]]>
michael@0 194 </setter>
michael@0 195 </property>
michael@0 196
michael@0 197 <property name="selectedPanel">
michael@0 198 <getter>
michael@0 199 <![CDATA[
michael@0 200 return this.childNodes[this.selectedIndex];
michael@0 201 ]]>
michael@0 202 </getter>
michael@0 203
michael@0 204 <setter>
michael@0 205 <![CDATA[
michael@0 206 var selectedIndex = -1;
michael@0 207 for (var panel = val; panel != null; panel = panel.previousSibling)
michael@0 208 ++selectedIndex;
michael@0 209 this.selectedIndex = selectedIndex;
michael@0 210 return val;
michael@0 211 ]]>
michael@0 212 </setter>
michael@0 213 </property>
michael@0 214 </implementation>
michael@0 215 </binding>
michael@0 216
michael@0 217 <binding id="dropmarker" extends="xul:button" role="xul:dropmarker">
michael@0 218 <resources>
michael@0 219 <stylesheet src="chrome://global/skin/dropmarker.css"/>
michael@0 220 </resources>
michael@0 221
michael@0 222 <content>
michael@0 223 <xul:image class="dropmarker-icon"/>
michael@0 224 </content>
michael@0 225 </binding>
michael@0 226
michael@0 227 <binding id="windowdragbox">
michael@0 228 <implementation>
michael@0 229 <field name="_dragBindingAlive">true</field>
michael@0 230 <constructor>
michael@0 231 if (!this._draggableStarted) {
michael@0 232 this._draggableStarted = true;
michael@0 233 try {
michael@0 234 let tmp = {};
michael@0 235 Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
michael@0 236 let draghandle = new tmp.WindowDraggingElement(this);
michael@0 237 draghandle.mouseDownCheck = function () this._dragBindingAlive;
michael@0 238 } catch (e) {}
michael@0 239 }
michael@0 240 </constructor>
michael@0 241 </implementation>
michael@0 242 </binding>
michael@0 243
michael@0 244 </bindings>

mercurial