To reproduce: 1) Create an empty test.js file to successfully XHR some file. 2) Create and run the following WebGL script: <html> <head> <script> function start(){ var canvas = document.getElementById('canvas'); var ctx = canvas.getContext("experimental-webgl"); var xhr = new XMLHttpRequest(); xhr.onload = function(){ alert(ctx.getError()); }; xhr.open("GET", "test.js", true); xhr.send(null); } </script> </head> <body onload="start();"> <canvas id="canvas"></canvas> </body> </html> WebKit will alert a WebGL error code 1280. Both Firefox and Chrome report error code 0.
Does this really have anything to do with XMLHttpRequest? Would you get the same result with setTimeout()?
I can't imagine that there's any interaction between XMLHttpRequest() specifically and WebGL. As Alexey points out, this is likely just a problem allocating the WebGL back buffer. Please attach the output from System Profiler so we can see what graphics card is in your machine.
Sorry for the (very long) wait: NVIDIA GeForce 8600M GT: Chipset Model: GeForce 8600M GT Type: GPU Bus: PCIe PCIe Lane Width: x16 VRAM (Total): 128 MB Vendor: NVIDIA (0x10de) Device ID: 0x0407 Revision ID: 0x00a1 ROM Revision: 3175 Displays: Color LCD: Resolution: 1440 x 900 Pixel Depth: 32-Bit Color (ARGB8888) Main Display: Yes Mirror: Off Online: Yes Built-In: Yes VX2262wm: Resolution: 1280 x 960 @ 60 Hz Pixel Depth: 32-Bit Color (ARGB8888) Mirror: Off Online: Yes Rotation: Supported This occurs more than just on my machine. I just tested with the latest Webkit: Version 5.0.5 (6533.21.1, r91108) and I still get the alert.
can reproduce with: setTimeout( function(){ alert(ctx.getError()); }, 1000); on the following configuration: AMD Radeon HD 6490M: Chipset Model: AMD Radeon HD 6490M Type: GPU Bus: PCIe PCIe Lane Width: x8 VRAM (Total): 256 MB Vendor: ATI (0x1002) Device ID: 0x6760 Revision ID: 0x0000 ROM Revision: 113-C0170H-504 gMux Version: 1.9.23 EFI Driver Version: 01.00.504
Can you add alert(ctx.getError()) right after "var ctx = canvas.getContext("experimental-webgl");" and see if you get an error or not.
I can reproduce this with a local build of r91135. Right after canvas.getContext(), the error in 0, but after a 1-second timeout, it's 1280. I have a MacBook Pro with NVIDIA GeForce 9400M.
(In reply to comment #6) > I can reproduce this with a local build of r91135. Right after canvas.getContext(), the error in 0, but after a 1-second timeout, it's 1280. > > I have a MacBook Pro with NVIDIA GeForce 9400M. and in between there are no other js code?
Created attachment 101174 [details] test case I just added an alert(). Attaching my complete test case, just in case. Note that WebGL works for me in this build otherwise (e.g. http://www.webkit.org/blog-files/webgl/SpiritBox.html does work).
OK, I can reproduce this on my MacBook Pro. I'll have a look.