Closed Bug 978860 Opened 12 years ago Closed 12 years ago

document.domain breaks texImage2D

Categories

(Core :: Graphics: CanvasWebGL, defect)

27 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: denis.bilenko, Unassigned)

References

Details

Attachments

(1 file)

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.
Normal origin checks should happen, it's just that effective script origin should not be used here.
Per bz bug 956382 fixed this. Might be good to check in a test.
Denis, is this still a problem in Firefox 30 for you?
Depends on: 956382
Flags: needinfo?(denis.bilenko)
Boris, it seems that the test case passes in Firefox 30. Thanks, should be OK to close.
Flags: needinfo?(denis.bilenko)
Resolving WORKSFORME based on comment 6.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
We know what fixed this. ;) Denis, thanks for the quick response!
Resolution: WORKSFORME → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: