dom/canvas/test/webgl-conf/checkout/conformance2/context/context-resize-changes-buffer-binding-bug.html
author Duncan McIntosh <dmcintosh@mozilla.com>
Wed, 09 Jul 2025 19:42:02 +0000 (4 hours ago)
changeset 795924 9ccc6a2267cbf69c621fec973bd28573c2a45a1f
parent 515042 f3948e689af746c84af3a24b00e0a33762d15cf7
permissions -rw-r--r--
Bug 1966586 - Reuse other browser windows when opening _blank links in Taskbar Tabs windows. r=nrishel This doesn't affect other tab additions, nor does it stop the tab bar from appearing altogether. The idea is that _if_ another tab is somehow made, the user should see it; but we should not create new tabs if we can avoid it. This also adds tests for opening URIs in popups and taskbar tabs to make it less likely that this breaks in future. Differential Revision: https://phabricator.services.mozilla.com/D253726
<!--
Copyright (c) 2019 The Khronos Group Inc.
Use of this source code is governed by an MIT-style license that can be
found in the LICENSE.txt file.
-->

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebGL2 Context Resize Bug Test</title>
<link rel="stylesheet" href="../../resources/js-test-style.css"/>
<script src="../../js/js-test-pre.js"></script>
<script src="../../js/webgl-test-utils.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<canvas id="test"></canvas>
<script>
"use strict";
description("This test verifies canvas resize does not affect PIXEL_UNPACK_BUFFER binding.");

var wtu = WebGLTestUtils;
var canvas = document.getElementById("test");
var gl = wtu.create3DContext(canvas, null, 2);
if (!gl) {
  testFailed("context does not exist");
} else {
  testPassed("context exists");
  var texture1= gl.createTexture();
  gl.bindTexture(gl.TEXTURE_3D, texture1);
  var buffer0= gl.createBuffer();
  gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buffer0);

  canvas.width = 682;
  // Resizing canvas incorrectly cleared the PIXEL_UNPACK_BUFFER binding to 0
  // and caused a crash from the following line in Chrome. crbug.com/673929.
  gl.texImage3D(gl.TEXTURE_3D, 1, gl.R8,  225,664 , 143, 0,
      gl.LUMINANCE_ALPHA, gl.UNSIGNED_SHORT_4_4_4_4, 0x41414141);
  testPassed("no crash from texImage3D");
}
debug("");
var successfullyParsed = true;
</script>
<script src="../../js/js-test-post.js"></script>

</body>
</html>