Closed Bug 401795 Opened 13 years ago Closed 9 years ago

Canvas toDataURL does not accept excess arguments

Categories

(Core :: Canvas: 2D, defect, P2)

defect

Tracking

()

RESOLVED DUPLICATE of bug 564388

People

(Reporter: philip, Unassigned)

References

()

Details

(Keywords: html5)

User-Agent:       Opera/9.24 (X11; Linux i686; U; en)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a9pre) Gecko/2007103004 Minefield/3.0a9pre

The spec explicitly says about the toDataURL(type) method:

   "Arguments other than the type must be ignored, and must not cause the user agent to raise an exception (as would normally occur if a method was called with the wrong number of arguments). A future version of this specification will probably allow extra parameters to be passed to toDataURL() to allow authors to more carefully control compression settings, image metadata, etc."


Reproducible: Always

Steps to Reproduce:
1. Call toDataURL with arguments other than type, from unprivileged content.

Actual Results:  
NS_ERROR_DOM_SECURITY_ERR is thrown.

Expected Results:  
The extra arguments should be ignored.

It looks like the extra arguments are used for some proprietary purpose by trusted code (hence the security exception in untrusted code). Since it directly contradicts the spec, either the implementation or the spec should be changed so they're consistent.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P2
Keywords: html5
Duplicate of this bug: 564388
Depends on: 564388
Fixed in bug 564388.
Status: NEW → RESOLVED
Closed: 9 years ago
No longer depends on: 564388
Resolution: --- → DUPLICATE
Duplicate of bug: 564388
Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.