Bug 117095 - HTMLCanvasElement getContext and supportsContext functions assumes that a canvas cannot be changed after creation
Summary: HTMLCanvasElement getContext and supportsContext functions assumes that a can...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-05-31 14:43 PDT by Ruth Fong
Modified: 2013-06-14 10:37 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ruth Fong 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.
Comment 1 Radar WebKit Bug Importer 2013-05-31 14:44:14 PDT
<rdar://problem/14037988>
Comment 2 Ian 'Hixie' Hickson 2013-06-14 10:00:50 PDT
Why is that a bug? Isn't that exactly what the spec requires?
Comment 3 Ruth Fong 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.
Comment 4 Dean Jackson 2013-06-14 10:37:14 PDT
I believe it was me who gave this erroneous suggestion.