https://github.com/mozilla/gecko-dev
Raw File
Tip revision: 12375f822667aac9cd0be1ad500c1f40e783d2fd authored by Julien Cristau on 16 August 2019, 07:55:03 UTC
No bug - bump version number to 68.0.3. a=release DONTBUILD
Tip revision: 12375f8
chrome_over_plugin_window.xul
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<window title="Content/chrome integration subwindow"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        onload="runTests()">\
  <!-- We're mainly testing that a) translucent chrome elements cause the plugin to be clipped away and
       b) translucent content elements do NOT cause the plugin to be clipped away -->
  <stack style="height:100px; width:150px;">
    <iframe type="content" style="border:none;" id="f"
            src="http://example.org/chrome/layout/base/tests/chrome/chrome_over_plugin_window_frame.html"/>
    <vbox>
      <vbox style="height:25px; background:yellow;"/> <!-- plugin should be covered here -->
      <vbox style="height:25px; background:rgba(0,128,0,0.5);"/> <!-- plugin should be covered here -->
      <vbox style="height:50px;"/> <!-- plugin should be visible here -->
    </vbox>
  </stack>

  <script type="application/javascript">
    <![CDATA[
    var imports = [ "SimpleTest", "is", "isnot", "ok", "todo" ];
    for (var name of imports) {
      window[name] = window.opener.wrappedJSObject[name];
    }

    var plugin;
    function waitForPaint() {
      if (plugin.getPaintCount() < 1) {
        setTimeout(waitForPaint, 0);
        return;
      }

      if (plugin.hasWidget()) {
        is(plugin.getClipRegionRectCount(), 1, "plugin clip rect count");
        var left = plugin.getEdge(0);
        var top = plugin.getEdge(1);
        is(plugin.getClipRegionRectEdge(0,0) - left, 0, "plugin clip rect left");
        // our two vboxes with backgrounds should cause the top of the plugin to be clipped
        is(plugin.getClipRegionRectEdge(0,1) - top, 50, "plugin clip rect top");
        is(plugin.getClipRegionRectEdge(0,2) - left, 100, "plugin clip rect right");
        // of the two content DIVs, the first one should not cause the plugin to be clipped because
        // it's transparent. The second one should cause the plugin to be clipped.
        is(plugin.getClipRegionRectEdge(0,3) - top, 90, "plugin clip rect bottom");
      } else {
        todo(false, "Test only tests windowed plugins");
      }

      var tester = window.SimpleTest;
      window.close();
      tester.finish();
    }

    function runTests() {
      plugin = document.getElementById("f").contentDocument.getElementById("e").wrappedJSObject;
      waitForPaint();
    }
    ]]>
  </script>
</window>
back to top