layout/reftests/canvas/1347147-1.html
author Petru Lingurar <petru.lingurar@softvision.ro>
Fri, 21 Jun 2019 06:24:43 +0000
changeset 539442 819d3061b8fb3cbc3143ac68e8f521b7e32f362c
parent 395821 fa6e1037d65d6d52240bf69ceaa18110b43301a7
permissions -rw-r--r--
Bug 1551614 - Call BrowserApp's onCreate() before finish(); r=VladBaicu Fix for the following scenario: - "Don't keep activities" checked - Change system language Upon detecting a locale change in BrowserApp's onCreate() we would call finish() and then return before calling super.onCreate(). This patch introdues the call to super.onCreate() before returning and ensures that the app will die cleanly so that upon restarting Gecko can reinit add-ons that touch the UI. Differential Revision: https://phabricator.services.mozilla.com/D35402

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <script>
      function draw() {
        var c = document.getElementById('c').getContext('2d');

        c.fillStyle = 'lime';
        c.fillRect(0, 0, 100, 50);

        var imgdata = c.createImageData(60, 50);
        for (var i = 0; i < imgdata.data.length; i += 4 * 60) {
            for (var x = i; x < i + 4 * 30; x += 4) {
                imgdata.data[x] = 255;
                imgdata.data[x+3] = 255;
            }
            for (var x = i + 4 * 30; x < i + 4 * 60; x += 4) {
                imgdata.data[x+2] = 255;
                imgdata.data[x+3] = 255;
            }
        }

        // Verify that putImageData is not affected by the current transform.
        c.translate(20, 0);
        c.putImageData(imgdata, 40, 0);
      }
    </script>
  </head>
  <body onload="draw();">
    <canvas id='c' width='100' height='50'></canvas>
  </body>
</html>