Closed
Bug 1135244
Opened 10 years ago
Closed 10 years ago
CanvasRenderingContext2D not allowing polyfill
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: tyler, Unassigned)
References
Details
(Keywords: regression)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36 Steps to reproduce: Upon using a well-known polyfill (canvas-5-polyfill*) to add an ellipse method to the CanvasRenderingContext2D prototype, we noticed that Firefox 3.5.01 regressed and does not allow the method to be added via a script. 1) include polyfill script in <head> 2) add a canvas to the page 3) ctx = getContext('2d') 4) note that ctx.ellipse is undefined Actual results: The ellipse method remained undefined, although the script adding it to the CanvasRenderingContext2D prototype had fully loaded and executed before the getContext('2d') call. This polyfill worked with Firefox v. 30 (and continues to work with IE9 & 10). Expected results: Until Firefox supports the ellipse function and other canvas v5 capabilities (https://bugzilla.mozilla.org/show_bug.cgi?id=910138), developers should at least be able to augment the existing Context2D object. Polyfills such as canvas-5-polyfill library have become the industry-standard way of adopting new features that may not be supported in all browsers. * https://github.com/google/canvas-5-polyfill
Note, we first noticed this on Windows 7, but I just confirmed the same behavior on Mac OS-X after updating from FF v. 30.
Comment 2•10 years ago
|
||
Could you upload a simple test file? It'd also be useful to know in which version exactly this would have regressed.
Component: Untriaged → Canvas: 2D
Flags: needinfo?(tyler)
Product: Firefox → Core
Here is a JSFiddle showing the issue: http://jsfiddle.net/rhf3wdwq/1/ An ellipse is drawn in: Firefox v. 22 (Win 7 pro) Internet Explorer 10.0.9 (Win 7 pro) Chrome 40.0.2214.111 (native method) An ellipse is NOT drawn and the method is undefined despite the polyfill in FF 35.0.1 on OS-X and Windows. Unfortunately I can't pinpoint where between version 30 and 35.0.1 the regression occurred, but it was functioning in 30 before I updated.
Flags: needinfo?(tyler)
Updated•10 years ago
|
Blocks: 988409
Keywords: regressionwindow-wanted
Comment 4•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=6a9a14232208&tochange=3034f954c0d4
Updated•10 years ago
|
Flags: needinfo?(cabanier)
Updated•10 years ago
|
Version: 35 Branch → 31 Branch
Comment 5•10 years ago
|
||
I'm unsure why this was assigned to me. I don't think the addition of path2d changes polyfilll behavior.
Comment 6•10 years ago
|
||
(In reply to Rik Cabanier from comment #5) > I'm unsure why this was assigned to me. I don't think the addition of path2d > changes polyfilll behavior. ctx.ellipse is undefined after landing Bug 988409 you assigned.
Comment 7•10 years ago
|
||
(In reply to Alice0775 White from comment #6) > (In reply to Rik Cabanier from comment #5) > > I'm unsure why this was assigned to me. I don't think the addition of path2d > > changes polyfilll behavior. > > ctx.ellipse is undefined after landing Bug 988409 you assigned. How did you come to that conclusion? Does it work if you turn the pref off?
Flags: needinfo?(cabanier)
Comment 8•10 years ago
|
||
Force canvas.path.enabled = true https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=760948237ca1&tochange=d6a918fe6c7c Regressed by: Bug 830734
Blocks: 830734
Comment 9•10 years ago
|
||
Looks like a bug in the library. <https://github.com/google/canvas-5-polyfill/blob/master/canvasv5.js> does roughly: if (typeof Path2D !== 'function') { if (CanvasRenderingContext2D.prototype.ellipse == undefined) { CanvasRenderingContext2D.prototype.ellipse = ...
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Updated•9 years ago
|
Keywords: testcase-wanted
You need to log in
before you can comment on or make changes to this bug.
Description
•