The default bug view has changed. See this FAQ.

Cross-domain textures generate NS_ERROR_FAILURE instead of NS_ERROR_DOM_SECURITY_ERR

VERIFIED FIXED in Firefox 6

Status

()

Core
Canvas: WebGL
VERIFIED FIXED
6 years ago
6 years ago

People

(Reporter: Scoobidiver (away), Unassigned)

Tracking

({regression})

5 Branch
mozilla7
x86
Windows 7
regression
Points:
---

Firefox Tracking Flags

(firefox5-, firefox6- fixed)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
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]
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.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 656277
Duplicate of bug: 662570
...though, you should have gotten a DOM_SECURITY_ERR error here... investigating.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Summary: Color Adjust Demo is blue: Infinite Failure arg 6 [nsIDOMWebGLRenderingContext.texSubImage2D] (NS_ERROR_FAILURE) → Cross-domain textures generate NS_ERROR_FAILURE instead of NS_ERROR_DOM_SECURITY_ERR
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.
Attachment #538928 - Flags: review?(jmuizelaar)
Depends on: 637077
(Reporter)

Updated

6 years ago
tracking-firefox5: --- → ?
tracking-firefox6: --- → ?

Comment 5

6 years ago
We'll live with the incorrect error for Firefox 5, tracking-firefox5:-
tracking-firefox5: ? → -
(Reporter)

Comment 6

6 years ago
(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).
(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/
Attachment #538928 - Flags: review?(jmuizelaar) → review+

Comment 8

6 years ago
We will not track this one specifically for Firefox 6 but we'd likely take a patch if it was nominated. Please do so.
tracking-firefox6: ? → -
Attachment #538928 - Flags: approval-mozilla-aurora?

Comment 9

6 years ago
Comment on attachment 538928 [details] [diff] [review]
patch

Approved for mozilla-aurora. Please land on mozilla-central as well.
Attachment #538928 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Landed on central:
http://hg.mozilla.org/mozilla-central/rev/baa619406bea
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago6 years ago
Resolution: --- → FIXED
Landed on aurora:
http://hg.mozilla.org/releases/mozilla-aurora/rev/124306745839

Updated

6 years ago
status-firefox6: --- → fixed
Target Milestone: --- → mozilla7
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"]
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.