Closed
Bug 978860
Opened 12 years ago
Closed 12 years ago
document.domain breaks texImage2D
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: denis.bilenko, Unassigned)
References
Details
Attachments
(1 file)
|
407 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:27.0) Gecko/20100101 Firefox/27.0 (Beta/Release)
Build ID: 20140212131424
Steps to reproduce:
Run this HTML on test.mydomain.com on Firefox 27.0.1 on Mac OS X.
<canvas id="C"></canvas>
<script>
document.domain = 'mydomain.com';
var T = new Image;
T.onload = function(){
var gl = C.getContext('webgl');
var t = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, t);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, T);
console.log('PASS');
};
T.src = 'test_webgl_xorigin.jpg';
</script>
Actual results:
19:24:09.586 Error: WebGL: It is forbidden to load a WebGL texture from a cross-domain element that has not been validated with CORS. See https://developer.mozilla.org/en/WebGL/Cross-Domain_Textures
19:24:09.586 SecurityError: The operation is insecure.
Expected results:
PASS printed to the console. If "document.domain = 'mydomain.com'" line is commented out, PASS is printed as expected.
| Reporter | ||
Comment 1•12 years ago
|
||
It seems similar to https://bugzilla.mozilla.org/show_bug.cgi?id=567511
This Subsumes(): http://dxr.mozilla.org/mozilla-central/source/content/canvas/src/WebGLContextGL.cpp?from=WebGLContextGL.cpp&case=true#2619 should likely be SubsumesIgnoringDomain, as per the patch for bug 567511.
Comment 3•12 years ago
|
||
Normal origin checks should happen, it's just that effective script origin should not be used here.
Comment 4•12 years ago
|
||
Per bz bug 956382 fixed this. Might be good to check in a test.
Comment 5•12 years ago
|
||
Denis, is this still a problem in Firefox 30 for you?
Depends on: 956382
Flags: needinfo?(denis.bilenko)
| Reporter | ||
Comment 6•12 years ago
|
||
Boris, it seems that the test case passes in Firefox 30. Thanks, should be OK to close.
Flags: needinfo?(denis.bilenko)
Comment 7•12 years ago
|
||
Resolving WORKSFORME based on comment 6.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
Comment 8•12 years ago
|
||
We know what fixed this. ;)
Denis, thanks for the quick response!
Resolution: WORKSFORME → FIXED
Updated•12 years ago
|
Target Milestone: --- → mozilla30
You need to log in
before you can comment on or make changes to this bug.
Description
•