Last Comment Bug 663823 - Cross-domain textures generate NS_ERROR_FAILURE instead of NS_ERROR_DOM_SECURITY_ERR
: Cross-domain textures generate NS_ERROR_FAILURE instead of NS_ERROR_DOM_SECUR...
Status: VERIFIED FIXED
: regression
Product: Core
Classification: Components
Component: Canvas: WebGL (show other bugs)
: 5 Branch
: x86 Windows 7
: -- normal (vote)
: mozilla7
Assigned To: Nobody; OK to take it and work on it
:
: Milan Sreckovic [:milan]
Mentors:
http://webglsamples.googlecode.com/hg...
Depends on: 637077
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-13 08:09 PDT by Scoobidiver (away)
Modified: 2011-08-31 04:36 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
-
-
fixed


Attachments
patch (2.35 KB, patch)
2011-06-13 09:42 PDT, Benoit Jacob [:bjacob] (mostly away)
jmuizelaar: review+
christian: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Scoobidiver (away) 2011-06-13 08:09:18 PDT
The Color Adjust demo is blue in Firefox 5.0b5. It is OK in 4.0.1.

The Web Console shows an infinite loop of the following error:
uncaught exception: [Exception... "Failure arg 6 [nsIDOMWebGLRenderingContext.texSubImage2D]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: http://webglsamples.googlecode.com/hg/color-adjust/color-adjust.html :: render :: line 437"  data: no]
Comment 1 Benoit Jacob [:bjacob] (mostly away) 2011-06-13 08:27:56 PDT
Just before the exception, I get this in the JS console:

Warning: WebGL: It is forbidden to load a WebGL texture from a cross-domain element. See https://developer.mozilla.org/en/WebGL/Cross-Domain_Textures
Source File: http://webglsamples.googlecode.com/hg/color-adjust/color-adjust.html
Line: 437

So this is just another demo broken by bug 656277. A tracking bug for such demos has been opened: bug 662570.

*** This bug has been marked as a duplicate of bug 656277 ***
Comment 2 Benoit Jacob [:bjacob] (mostly away) 2011-06-13 08:28:12 PDT

*** This bug has been marked as a duplicate of bug 662570 ***
Comment 3 Benoit Jacob [:bjacob] (mostly away) 2011-06-13 08:29:46 PDT
...though, you should have gotten a DOM_SECURITY_ERR error here... investigating.
Comment 4 Benoit Jacob [:bjacob] (mostly away) 2011-06-13 09:42:23 PDT
Created attachment 538928 [details] [diff] [review]
patch

This is a quite stupid patch in already stupid code; the reason why it's so dumb is that it has to determine whether the argument is a DOMElement or ImageData and we don't have a real ImageData interface, see bug 637077, so it has to use duck typing. We should revisit this whole code once bug 637077 is fixed.
Comment 5 christian 2011-06-13 14:36:58 PDT
We'll live with the incorrect error for Firefox 5, tracking-firefox5:-
Comment 6 Scoobidiver (away) 2011-06-14 01:02:28 PDT
(In reply to comment #5)
> We'll live with the incorrect error for Firefox 5, tracking-firefox5:-
The main issue is not about an incorrect error but about a non-working Google demo (regression from 4.0.1).
Comment 7 Benoit Jacob [:bjacob] (mostly away) 2011-06-14 07:58:01 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > We'll live with the incorrect error for Firefox 5, tracking-firefox5:-
> The main issue is not about an incorrect error but about a non-working
> Google demo (regression from 4.0.1).

This is a known unavoidable problem, see bug 662570 and 
http://hacks.mozilla.org/2011/06/cross-domain-webgl-textures-disabled-in-firefox-5/
Comment 8 christian 2011-06-15 11:50:24 PDT
We will not track this one specifically for Firefox 6 but we'd likely take a patch if it was nominated. Please do so.
Comment 9 christian 2011-06-16 15:11:58 PDT
Comment on attachment 538928 [details] [diff] [review]
patch

Approved for mozilla-aurora. Please land on mozilla-central as well.
Comment 10 Benoit Jacob [:bjacob] (mostly away) 2011-06-27 10:47:58 PDT
Landed on central:
http://hg.mozilla.org/mozilla-central/rev/baa619406bea
Comment 11 Benoit Jacob [:bjacob] (mostly away) 2011-06-27 10:51:16 PDT
Landed on aurora:
http://hg.mozilla.org/releases/mozilla-aurora/rev/124306745839
Comment 12 Simona B [:simonab ] 2011-08-31 04:36:45 PDT
Mozilla/5.0 (Windows NT 6.1; rv:7.0) Gecko/20100101 Firefox/7.0

Marking VERIFIED because if I visit the page in Firefox 7 i get the correct error [18:30:45.840] uncaught exception: 
[Exception... "Security error"  code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)"  location: "http://webglsamples.googlecode.com/hg/color-adjust/color-adjust.html Line: 437"]

Note You need to log in before you can comment on or make changes to this bug.