<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'
      xmlns:xbl='http://www.w3.org/ns/xbl'
      xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <head>
    <title>XBL 2.0 Test Suite: Handler test - trusted</title>
    <style type='text/css'>
     #a1 { background-color: red; }
     #a2 { background-color: green; }
     #a3 { background-color: red; }
    </style> 
    <xbl xmlns="http://www.w3.org/ns/xbl">
     <binding id="b1" element="#a1">
      <handlers>
        <handler id="hand1" event="click" trusted="true">
         document.getElementById("a1").setAttribute("style", "background-color: green;");
         var evt = document.createEvent("MouseEvents");
         evt.initMouseEvent("click", true, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
         document.getElementById("a2").dispatchEvent(evt);
         document.getElementById("a3").dispatchEvent(evt);
        </handler>
       </handlers>
      </binding>
     <binding id="b2" element="#a2">
      <handlers>
        <handler id="hand1" event="click" trusted="true">
         document.getElementById("a2").setAttribute("style", "background-color: red;");
        </handler>
      </handlers>
    </binding>
     <binding id="b3" element="#a3">
      <handlers>
        <handler id="hand1" event="click" trusted="false">
         document.getElementById("a3").setAttribute("style", "background-color: green;");
        </handler>
      </handlers>
    </binding>
    </xbl> 
  </head>
  <body> 
   <span id="a1">
    Click only this. Should change to green.
   </span>
   <span id="a2">
    Should stay green.
   </span>
   <span id="a3">
    Should change green.
   </span>
  </body>
</html>
