content/xml/document/resources/XMLPrettyPrint.xml

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <?xml version="1.0"?>
     2 <!-- This Source Code Form is subject to the terms of the Mozilla Public
     3    - License, v. 2.0. If a copy of the MPL was not distributed with this
     4    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
     6 <bindings xmlns="http://www.mozilla.org/xbl"
     7           xmlns:html="http://www.w3.org/1999/xhtml">
     9   <binding id="prettyprint">
    11     <content><html:div id='top'/>
    12       <html:span style="display: none;"><children/></html:span>
    13     </content>
    15     <handlers>
    16       <handler event="click" button="0">
    17       <![CDATA[
    18         try {
    19           var par = event.originalTarget;
    20           if (par.nodeName == 'div' && par.className == 'expander') {
    21             if (par.parentNode.className == 'expander-closed') {
    22               par.parentNode.className = 'expander-open';
    23               event.originalTarget.firstChild.data = '\u2212';
    24             }
    25             else {
    26               par.parentNode.className = 'expander-closed';
    27               event.originalTarget.firstChild.data = '+';
    28             }
    29           }
    30         } catch (e) {
    31         }
    32       ]]>
    33       </handler>
    34       <handler event="prettyprint-dom-created" allowuntrusted="false">
    35         <![CDATA[
    36           document.getAnonymousNodes(this).item(0).appendChild(event.detail);
    37         ]]>
    38       </handler>
    39     </handlers>
    41   </binding>
    43 </bindings>

mercurial