Sat, 03 Jan 2015 20:18:00 +0100
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 | <bindings id="expanderBindings" |
michael@0 | 7 | xmlns="http://www.mozilla.org/xbl" |
michael@0 | 8 | xmlns:xbl="http://www.mozilla.org/xbl" |
michael@0 | 9 | xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
michael@0 | 10 | |
michael@0 | 11 | <binding id="expander" display="xul:vbox"> |
michael@0 | 12 | <resources> |
michael@0 | 13 | <stylesheet src="chrome://global/skin/expander.css"/> |
michael@0 | 14 | </resources> |
michael@0 | 15 | <content> |
michael@0 | 16 | <xul:hbox align="center"> |
michael@0 | 17 | <xul:button type="disclosure" class="expanderButton" anonid="disclosure" xbl:inherits="disabled" mousethrough="always"/> |
michael@0 | 18 | <xul:label class="header expanderButton" anonid="label" xbl:inherits="value=label,disabled" mousethrough="always" flex="1"/> |
michael@0 | 19 | <xul:button anonid="clear-button" xbl:inherits="label=clearlabel,disabled=cleardisabled,hidden=clearhidden" mousethrough="always" icon="clear"/> |
michael@0 | 20 | </xul:hbox> |
michael@0 | 21 | <xul:vbox flex="1" anonid="settings" class="settingsContainer" collapsed="true" xbl:inherits="align"> |
michael@0 | 22 | <children/> |
michael@0 | 23 | </xul:vbox> |
michael@0 | 24 | </content> |
michael@0 | 25 | <implementation> |
michael@0 | 26 | <constructor><![CDATA[ |
michael@0 | 27 | var settings = document.getAnonymousElementByAttribute(this, "anonid", "settings"); |
michael@0 | 28 | var expander = document.getAnonymousElementByAttribute(this, "anonid", "disclosure"); |
michael@0 | 29 | var open = this.getAttribute("open") == "true"; |
michael@0 | 30 | settings.collapsed = !open; |
michael@0 | 31 | expander.open = open; |
michael@0 | 32 | ]]></constructor> |
michael@0 | 33 | <property name="open"> |
michael@0 | 34 | <setter> |
michael@0 | 35 | <![CDATA[ |
michael@0 | 36 | var settings = document.getAnonymousElementByAttribute(this, "anonid", "settings"); |
michael@0 | 37 | var expander = document.getAnonymousElementByAttribute(this, "anonid", "disclosure"); |
michael@0 | 38 | settings.collapsed = !val; |
michael@0 | 39 | expander.open = val; |
michael@0 | 40 | if (val) |
michael@0 | 41 | this.setAttribute("open", "true"); |
michael@0 | 42 | else |
michael@0 | 43 | this.setAttribute("open", "false"); |
michael@0 | 44 | return val; |
michael@0 | 45 | ]]> |
michael@0 | 46 | </setter> |
michael@0 | 47 | <getter> |
michael@0 | 48 | return this.getAttribute("open"); |
michael@0 | 49 | </getter> |
michael@0 | 50 | </property> |
michael@0 | 51 | <method name="onCommand"> |
michael@0 | 52 | <parameter name="aEvent"/> |
michael@0 | 53 | <body><![CDATA[ |
michael@0 | 54 | var element = aEvent.originalTarget; |
michael@0 | 55 | var button = element.getAttribute("anonid"); |
michael@0 | 56 | switch (button) { |
michael@0 | 57 | case "disclosure": |
michael@0 | 58 | case "label": |
michael@0 | 59 | if (this.open == "true") |
michael@0 | 60 | this.open = false; |
michael@0 | 61 | else |
michael@0 | 62 | this.open = true; |
michael@0 | 63 | break; |
michael@0 | 64 | case "clear-button": |
michael@0 | 65 | var event = document.createEvent("Events"); |
michael@0 | 66 | event.initEvent("clear", true, true); |
michael@0 | 67 | this.dispatchEvent(event); |
michael@0 | 68 | break; |
michael@0 | 69 | } |
michael@0 | 70 | ]]></body> |
michael@0 | 71 | </method> |
michael@0 | 72 | </implementation> |
michael@0 | 73 | <handlers> |
michael@0 | 74 | <handler event="command"><![CDATA[ |
michael@0 | 75 | this.onCommand(event); |
michael@0 | 76 | ]]></handler> |
michael@0 | 77 | <handler event="click"><![CDATA[ |
michael@0 | 78 | if (event.originalTarget.localName == "label") |
michael@0 | 79 | this.onCommand(event); |
michael@0 | 80 | ]]></handler> |
michael@0 | 81 | </handlers> |
michael@0 | 82 | </binding> |
michael@0 | 83 | |
michael@0 | 84 | </bindings> |
michael@0 | 85 | |
michael@0 | 86 |