Bug 117095

Summary: HTMLCanvasElement getContext and supportsContext functions assumes that a canvas cannot be changed after creation
Product: WebKit Reporter: Ruth Fong <ruthiecftg>
Component: CanvasAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: dino, ian, ruthiecftg, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Ruth Fong
Reported 2013-05-31 14:43:55 PDT
The implementations of getContext and supportsContext (once the patch for bug 70117 is landed) in Source/WebCore/html/HTMLCanvasElement.cpp depends on the assumption that the context does not go away upon creation (to prevent JS form seeing a dangling pointer) and disallows the context from being changed once it is created. Thus, if a 3d context exists for a <canvas> element (by calling canvas.getsContext('webkit-3d') and supportsContext('2d') is subsequently called on that <canvas> element, then canvas.supportsContext('2d') will return false because a 3d context already exists.
Attachments
Radar WebKit Bug Importer
Comment 1 2013-05-31 14:44:14 PDT
Ian 'Hixie' Hickson
Comment 2 2013-06-14 10:00:50 PDT
Why is that a bug? Isn't that exactly what the spec requires?
Ruth Fong
Comment 3 2013-06-14 10:34:53 PDT
(In reply to comment #2) > Why is that a bug? Isn't that exactly what the spec requires? Just checked with Dean; you're right.
Dean Jackson
Comment 4 2013-06-14 10:37:14 PDT
I believe it was me who gave this erroneous suggestion.
Note You need to log in before you can comment on or make changes to this bug.