dom/xbl/crashtests/set-field-bad-this.xhtml

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.

     1 <html xmlns="http://www.w3.org/1999/xhtml">
     3 <head>
     4   <title>Gracefully handle setting a field on a bad |this|</title>
     6   <bindings xmlns="http://www.mozilla.org/xbl">
     7     <binding id="a">
     8       <implementation>
     9         <field name="f">17</field>
    10       </implementation>
    11     </binding>
    12   </bindings>
    14   <script type="application/javascript">
    15     window.onload = function()
    16     {
    17       var bound = document.getElementById("bound");
    18       try
    19       {
    20         Object.getPrototypeOf(bound).f = 42;
    21       }
    22       catch (e) { /* Throwing's fine, crashing isn't. */ }
    23     };
    24   </script>
    25 </head>
    27 <body>
    28   <div id="bound" style="-moz-binding: url(#a)"></div>
    29 </body>
    31 </html>

mercurial